<?php use_helper('I18N') ?>

<div class="already_account">
    <h2 class="title"><span>J'ai déja un compte</span></h2>

    <?php foreach($form as $field => $f): ?>
        <?php $attributes[$field] = array() ?>
    <?php endforeach ?>

    <?php if ($form->hasErrors()): ?>
        <?php foreach($form as $field => $f): ?>
            <?php if($f->hasError()): ?>
                <?php $attributes[$field] = array('class' => 'error') ?>
            <?php endif ?>
        <?php endforeach ?>
        <div class="box_relief red">Certains champs sont incomplets et/ou invalides.</div>
    <?php endif; ?>

    <form action="<?php echo url_for('@sf_guard_signin') ?>" method="post">
      <table>
        <tbody>
            <tr>
                <td></td>
                <td><?php echo $form['username']->renderError() ?></td>
            </tr>
            <tr>
                <th><?php echo $form['username']->renderLabel('Login ou email :', $attributes['username']) ?></label></th>
                <td><?php echo $form['username']->render() ?></td>
            </tr>
            <tr>
                <td></td>
                <td><?php echo $form['password']->renderError() ?></td>
            </tr>
            <tr>
                <th><?php echo $form['password']->renderLabel('Mot de passe :', $attributes['username']) ?></label></th>
                <td><?php echo $form['password']->render() ?></td>
            </tr>
            <tr>
                <td></td>
                <td><?php echo $form['remember']->renderError() ?></td>
            </tr>
            <tr>
                <td class="remember_me" colspan ="2">
                    <?php echo $form['remember']->renderLabel('Se souvenir de moi :', $attributes['remember']) ?></label>
                    <?php echo $form['remember']->render() ?>
                    <?php echo $form->renderHiddenFields() ?>
                </td>
            </tr>
        </tbody>
        <tfoot>
          <tr>
            <td colspan="2">
              <input class="box_relief dark_blue" type="submit" value="Se connecter" />
              <p class="forgotten_password">J'ai oublié mon mot de passe : <?php echo link_to('Cliquez ici', 'sfApply/resetRequest')  ?></p>
            </td>
          </tr>
        </tfoot>
      </table>
    </form>
</div>

<div class="new_account">
    <h2 class="title"><span>Je suis nouveau</span></h2>
    <?php echo link_to(__('Create a New Account',array(),'sfForkedApply'), 'sfApply/apply', array('class' => 'box_relief dark_blue')) ?>
</div>

<div class="push_float"></div>